package com.softline.documentsmall.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.softline.documentsmall.entity.Collection;
import com.softline.documentsmall.entity.CollectionVO;
import java.util.List;

/**
 * @program: documentsmall
 * @description:
 * @author: wmj
 * @create: 2020-12-09
 * @ClassName: CollectionService
 */
public interface CollectionService extends IService<Collection> {

    /**
     * 收藏
     * @param collection
     * @return
     */
    int add(Collection collection);

    /**
     * 根据passportId和词条id取消收藏
     * @param passportId
     * @param dictionaryId
     */
    void delete(String passportId, Integer dictionaryId);

    /**
     * 根据passportId查询收藏记录
     * @param passportId
     * @return
     */
    List<CollectionVO> getReconds(String passportId,String type,Integer pageNo, Integer pageSize);

    /**
     * 根据词条id和用户查询是否收藏，1：收藏，0：未收藏
     * @param passportId
     * @param dictionaryId
     * @return
     */
    Collection isCollection(String passportId, Integer dictionaryId);
}
